local skynet = require "skynet"
local msghelper = require "recordsvrhelper"
local serverbase = require "serverbase"
local base = require "base"

local params = ...
local Recordsvrd = serverbase:new({})

function Recordsvrd:tostring()
	return "Recordsvrd"
end

local function Recordsvrd_to_sring()
	return Recordsvrd:tostring()
end

function Recordsvrd:init()
	msghelper:init(Recordsvrd)
	self.eventmng.init(Recordsvrd)
	self.eventmng.add_eventbyname("cmd", "recordsvrcmd")
	
	Recordsvrd.__tostring = Recordsvrd_to_sring
end

skynet.start(function()  
	if params == nil then
		Recordsvrd:start()
	else		
		Recordsvrd:start(table.unpack(base.strsplit(params, ",")))
	end	
end)
